package com.bbs.controller;

import com.bbs.resp.Result;
import com.bbs.service.ArticlesService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/article")
public class ArticleController {

    @Resource
    private ArticlesService articlesService;

    @GetMapping("/search")
    public Result findByLike(@RequestParam String q){

        return articlesService.findByLike(q);
    }
}
